<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>好好吃商城</title>
<link type="text/css" href="css/css.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/js.js"></script>
<script src="js/wb.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
 $(function(){
	 $(".vipNav dd:first").show();
	 })
</script>
</head>

<body>
 <div class="mianCont"id="app" >
  <div class="top">
   <span>您好！欢迎来到好好吃商城 </span>
   <span class="topRight">
    <a href="vip.html">好好吃</a>&nbsp;|
    <a href="order.html">我的订单</a>&nbsp;| 

    <a href="#">联系我们</a>
   </span>
  </div><!--top/-->
  <div class="lsg">
   <h1 class="logo"><a href="index.html"><img src="img/logo.png" width="217" height="90" /></a></h1>


  </div><!--lsg/-->
  <div class="pnt">
   <div class="pntLeft">
    <h2 class="Title">所有商品分类

    </h2>
   </div><!--pntLeft/-->
   <div class="pntRight">
    <ul class="nav">
     <li><a href="index.html">商城首页</a></li>
     <li><a href="product.html">促销中心</a></li>
     <li><a >会员中心</a></li>
     <li><a href="help.html">帮助中心</a></li>
     <div class="clears"></div>
     <div class="phone">TEL：021-12345678</div>
    </ul><!--nav/-->
   </div><!--pntRight/-->
   <div class="clears"></div>
  </div><!--pnt/-->
  <div class="positions">
   当前位置：<a href="index.html">首页</a> &gt; <a href="vip.html">会员中心</a>
    &gt; <a href="#" class="posCur">我的订单</a>
  </div><!--positions/-->
  <div class="cont">
   <div class="contLeft" id="contLeft">
    <h3 class="leftTitle">会员中心</h3>
    <dl class="helpNav vipNav">
     <dt>我的主页</dt>
      <dd>
       <a href="vip.html" class="vipCur">个人中心</a>
       <a href="vipOrder.html">我的订单</a>
       <a href="collect.html" class="vipCur">我的收藏</a>
       <a href="order.html" class="vipCur">我的购物车</a>
      </dd>
     <dt>账户设置</dt>
      <dd>
       <a href="#">个人信息</a>
       <a href="#">密码修改</a>
       <a href="#">收货地址</a>
      </dd>
      <dt>客户服务</dt>
       <dd>
        <a href="help.html">网站使用条款</a>
        <a href="help.html">网站免责声明</a>
        <a href="help.html">在线留言</a>
       </dd>


    </dl><!--helpNav/-->
   </div><!--contLeft/-->
   <div class="contRight">
          <h1 class="vipName"><span>用户名：</span>{{data.name}} <strong class="vipUp">[点击修改密码]</strong><strong class="vipUp" @click="exit">[点击退出登陆]</strong></h1>
    <table class="vipMy">
     <tr>
      <th>账号</th>
      <th>姓名</th>
      <th>性别</th>
      <th>年龄</th>
      <th>电话</th>
      <th>地址</th>
     </tr>
     <tr >
      <td>{{data.xh}}</td>
      <td>{{data.name}}</td>
      <td>{{data.sex}}</td>
      <td>{{data.age}}</td>
      <td>{{data.xh}}</td>
      <td>{{data.address}}</td>
     </tr>
    </table><!--vipMy/-->
    <div class="address" >
    <div class="addList">
     <label><span class="red">* </span>账号:</label>
     <input type="text" id="xh1"/>
    </div><!--addList-->

    <div class="addList">
     <label><span class="red">* </span>新密码:</label>
     <input type="password" id="password2"/>
    </div>
     <div class="addList">
      <label><span class="red">* </span>确认新密码:</label>
      <input type="password" id="password3"/>
    </div><!--addList-->
    <div class="addList2" >
     <input type="image" src="img/baocun.png" width="79" height="30" />
    </div><!--addList2/-->
   </div><!--address/-->
   </div><!--contRight/-->
   <div class="clears"></div>
  </div><!--cont/-->
  <div class="inHelp">
   <div class="inHLeft">
    <h4>帮助中心</h4>
    <ul class="inHeList">
     <li><a href="help.html">购物指南</a></li>
     <li><a href="help.html">支付方式</a></li>
     <li><a href="help.html">售后服务</a></li>
     <li><a href="#">企业简介</a></li>
     <div class="clears"></div>
    </ul><!--inHeList/-->
   </div><!--inHLeft/-->
   <div class="inHLeft">
    <h4>会员服务</h4>
    <ul class="inHeList">
     <li><a href="reg.html">会员注册</a></li>
     <li><a href="login.html">会员登录</a></li>
     <li><a href="order.html">购物车</a></li>
     <li><a href="order.html">我的订单</a></li>
     <div class="clears"></div>
    </ul><!--inHeList/-->
   </div><!--inHLeft/-->
   <div class="inHRight">
    <h4>全国统一免费服务热线</h4>
    <div class="telBox">400-0000-0000</div>
    <div class="weibo">

    </div>
   </div><!--inHRight/-->
   <div class="clears"></div>
  </div><!--inHelp/-->
  <div class="footer">
   <p>
   <a href="#">进入好好吃官网</a>&nbsp;|&nbsp;
   <a href="index.html">商城首页</a>&nbsp;|&nbsp;
   <a href="product.html">促销中心</a>&nbsp;|&nbsp;
   <a href="order.html">我的订单</a>&nbsp;|&nbsp;
   <a href="#">新闻动态</a>&nbsp;|&nbsp;
   <a href="vip.html">会员中心</a>&nbsp;|&nbsp;
   <a href="help.html">帮助中心</a>
   </p>
   <p>
    版权所有：好好吃实业有限公司 版权所有  Copyright 2010-2015   沪ICP备00000000号
   </p>
  </div><!--footer/-->
 </div><!--mianCont/-->
<!-- //<script type="text/javascript" src="js/jquery.cookie.js"></script>-->
 <script type="text/javascript" src="js/vue.js"></script>
 <script type="text/javascript" src="js/config.js"></script>
 <script type="text/javascript" src="js/jquery.cookie.js"></script>
 <script type="module" >



// name=$.cookie('name');
 //var password
  //password=$.cookie('name2');
  //alert(name)
 // alert(password)
var app=new Vue({
 el:"#app",
data:{
  data:[],
},
 methods:{
  exit() {

   $.ajax({
    url: config.USER_EXIT,
    type: "post",
    dataType: "json",
    data: {},
    success: function (data) {
    alert("退出登陆成功")

      $(window).attr('location', 'login.html');
    }


   })
  }
 }
})
$(document).ready(function (){


 $.ajax({
  url:config.USER_LOGINCHECK,
  type:"post",
  dataType:"json",
  data:{

  },
  success:function (data) {
   app.data=data.data
   /*vm.xh=data.data.xh;
   vm.name=data.data.name;
   vm.age=data.data.age;
   vm.sex=data.data.sex;
   vm.address=data.data.address*/
console.log(app.data)
  }

 })
})
$("#xh1").blur(function (){
 if (app.data.xh==$("#xh1").val()){
  return
 }else {
  alert("请输入自己正确的账号")
 }
})


$("#password3").blur(function (){
 if($("#password2").val()==$("#password3").val()){
  return
 }else{
  alert("两次密码不一致")
 }
})

$('.addList2').click(function (){
if (app.data.xh==$("#xh1").val()){
 if ($("#password2").val()==""||$("#password3").val()==""){
  alert("请输入密码")
 }else {

  $.ajax({
   url: config.USER_UPDATEPSWD,
   type: "post",
   dataType: "json",
   data: {
    "xh":$("#xh1").val(),
    "password":$("#password3").val()
   },
   success: function (data) {
                $.ajax({
                 url: config.USER_EXIT,
                 type: "post",
                 dataType: "json",
                 data: {
                 },
                 success: function (data) {
                  alert("修改密码成功")
                  $(window).attr('location', 'login.html');

                 }

         })
   }
        })
 }
}else {
 alert('请输入您自己正确的账号')
}



})
  </script>
</body>
</html>